﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace Study.Ajax
{
    /// <summary>
    /// lang 的摘要说明
    /// </summary>
    public class lang : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            string lang = context.Request["lang"].ConvertObjToStr();
            HttpCookie cookie = new HttpCookie("USER_COOKIE");
            if (lang != "" && lang != null)
            {
                context.Session["lang"] = lang;
                cookie.Values.Add("lang", lang);
                cookie.Expires = DateTime.MaxValue;
                //cookie.HttpOnly = true;
                context.Response.Cookies.Add(cookie);
            }

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}